<template>
    <div>
      <el-form :inline="true" :model="shop" class="demo-form-inline">
        <el-form-item label="商品编号">
          <el-input v-model="shop.shopNumber" readonly></el-input>
        </el-form-item>
        <el-form-item label="商品名">
          <el-input v-model="shop.shopName" readonly></el-input>
        </el-form-item>
        <el-form-item label="供应商提供价格">
          <el-input v-model="shop.supplierPrice" placeholder="提供价格"></el-input>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
        name: "supply_of_goods_dialog",
        data(){
          return{
            shopId:"",
            shop:{
              supplierPrice:""
            }
          }
        },
        methods:{
          getObject(id){
            this.shopId=id;
            //根据id，获取该商品对象
            this.$axios.get("shop/queryShopById.action/"+id,null).
            then(response=>{
              this.shop = response.data;
            }).
            catch();
          },
          submit(){
            //组装数据
            let supplierSupplyOfGoods={
              gid:this.shop.id,
              pid:sessionStorage.getItem("id"),
              supplierPrice:this.shop.supplierPrice
            }
            //调用异步，添加供应商商品表数据
            this.$axios.put("supplierSupplyOfGoods/supplierSupplyOfGoods.action/",supplierSupplyOfGoods).
            then(response=>{
              if(response.data.x){
                this.$message.success(response.data.msg);
              }else {
                this.$message.error(response.data.msg);
              }
            }).
            catch();
          }
        },
        created() {

        }
    }
</script>

<style scoped>

</style>
